<template>
	<view>
		<!--顶部区域-->
		<view class="smart-page-head">
			<view class="smart-page-head-title"> text
			</view>
			<view class="smart-padding-wrap">
				<view class="text-box" scorll-y="true">
					<text>{{ text }}</text>
					</view>
					<button type="primary" :disabled="!canAdd" @click="add">add line</button>
					<button type="warn" :disabled="!canRemove" @click="remove">Sremove line</button>
					</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				texts: [
					'HBuilder, 400万开发者选择的IDE',
					'HBuiliderX 轻巧极速极客编辑器',
					'uni-app,终极跨平台方案',
					'HBuilder, 400万开发者选择的IDE',
					'HBuiliderX, 轻巧极速极客编辑器',
					'uni-app, 终极跨平台方案',
					'HBuilder, 400万开发者平台选择的IDE',
					'HBuilideX, 轻巧极速极客编辑器',
					'uni-app,终极跨平台方案',
					'......'
					],
					text: '',
					canAdd: true,
					canRemove: false,
					extraline: []
			};
		},
		methods: {
			add: function(e) {
				this.extraline.push(this.texts[this.extraline.lengh % 12]);
				this.text = this.extraline.join('\n');
				this.canAdd = this.extraline.length <12;
				this.canRemove = this.extraline.length > 0;
			}
			
		}
	}
	};
</script>

<style>

</style>
